powerpc: Fix -mcpu= options for SPE-only compiler
authorBen Hutchings <ben@decadent.org.uk>
Wed, 26 Dec 2018 00:00:40 +0000 (00:00 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 15 Mar 2019 02:16:04 +0000 (02:16 +0000)
GCC for Debian's "powerpcspe" architecture only supports 32-bit
SPE targets, and using -mcpu=powerpc or -mcpu=powerpc64 is a fatal
error.

* Change the test for a biarch compiler to pass both the -m32 and -m64
  options, so that it doesn't catch 32-bit-only compilers
* Add an ifdef CONFIG_PPC64 around the 64-bit CPU option definitions

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/powerpc
Gbp-Pq: Name powerpc-fix-mcpu-options-for-spe-only-compiler.patch

arch/powerpc/Makefile

index c4c03992ee828c5805fd24cffdf6fadaa0724714..8d63aa3ac059936b2aa8413d0d68ed5f8bd6a3f8 100644 (file)
@@ -12,7 +12,7 @@
 # Rewritten by Cort Dougan and Paul Mackerras
 #
 
-HAS_BIARCH     := $(call cc-option-yn, -m32)
+HAS_BIARCH     := $(call cc-option-yn, -m32 -m64)
 
 # Set default 32 bits cross compilers for vdso and boot wrapper
 CROSS32_COMPILE ?=
@@ -148,6 +148,7 @@ CFLAGS-$(CONFIG_PPC64)      += $(call cc-option,-mno-pointers-to-nested-functions)
 CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD)
 CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata)
 
+ifdef CONFIG_PPC64
 ifdef CONFIG_PPC_BOOK3S_64
 ifdef CONFIG_CPU_LITTLE_ENDIAN
 CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8
@@ -159,6 +160,7 @@ endif
 else
 CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
 endif
+endif
 
 ifdef CONFIG_FUNCTION_TRACER
 CC_FLAGS_FTRACE := -pg